home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
sticpsrc.lzh
/
DOC
/
SCC.ARC
/
SCC.TXT
< prev
Wrap
Text File
|
1990-03-02
|
19KB
|
440 lines
The Z8530 SCC driver for the Atari ST and PC Clones
By R.E. Janssen, PE1CHL.
A driver has been written to support a number of Z8530 SCC chips
connected to an Atari ST computer. The driver is configurable
for different hardware configurations, and an example schematic
supporting up to 7 SCC's (14 channels) has been included.
The driver now also runs on PC Clones, although the interrupt
handling capabilities of this type of computer limits the maximum
speed and number of channels to a lower value than on the Atari.
(depending on the speed of your machine)
Each channel may be indepently programmed to support:
- An asynchronous SLIP line
- An asynchronous interface to a KISS TNC
- Direct AX.25 (HDLC)
The software has been written in such a way that a port to
another environment where Z8530 SCC's are available should be
relatively straightforward. Addresses of the chips are
completely configurable, and most probably only the first-level
interrupt handler (written in assembly language) has to be
adapted to the specific configuration of the interrupt
acknowledge logic in the system.
The PC version supports a few special types of interface board,
that use specific IO ports to control certain on-board features
like MODEMs and interrupt configuration.
Initialization and attachment of the channels
To use the driver, 2 steps must be performed:
1. Global initialization of the driver
2. Attachment of each channel, specifying mode and options
The global initialization is needed to reset all SCCs and to
install a common interrupt handler. Also, the hardware addresses
of the chips are defined in this step. In the second step, each
channel is set up for the intended use.
1. Initialization
Initialization is performed using the "attach scc init" command,
using the following syntax:
attach scc <number of chips> init <base address>
<spacing between chips> <offset to channel A ctrl>
<offset to channel B ctrl> <offset from ctrl to data>
<address of INTACK latch>|0 <interrupt number>
p<PCLK frequency>|r<RTxC frequency>
[<special interface type> <interface parameter>]
To initialize a board with 2 SCCs using my schematic, the
following command would be used:
attach scc 2 init fffd00 8 3 7 -2 fffd3f 3 p4915200
This specifies interrupt number 3, a normally unused interrupt in
520ST and 1040ST machines. In the newer Mega-ST this interrupt
is used for the Blitter. In this case, it is possible to use the
"ring indicator" input of the RS232 interface as an interrupt
source. It has interrupt number 14.
The INTACK latch (write, then read to get the interrupt vector)
is located at 0xfffd3f. It is also possible to specify 0 for
this address. In that case, INTACK is not used and the driver
finds the interrupting chip by polling each RR3A register. This
allows a more simple hardware design, especially for PCs.
The crystal clock is specified as 4.9152 MHz. Other frequencies
can be used, and this parameter should be adjusted accordingly.
The clock used for baudrate generation is connected to PCLK. It
would also be possible to supply a baudrate clock to RTxC, and a
clock of a different frequency to PCLK (like the processor
clock). This option is selected by prefixing the clock frequency
with an "r" instead of a "p".
The "special interface type" and "interface parameter" fields can
be used to specify some special type of interface board to be
used. This requires modification to the driver software.
Currently, the following special types are supported on the PC:
- type 1: EAGLE
- type 2: PC-100
- type 4: PRIMUS
- type 8: DRSI PC*Packet
The PC-100 and the PRIMUS accept an interface parameter, that is
used to control the on-board MODEM. It must be specified as a
hexadecimal value to be sent to the output port on the board.
Possible initialisation commands are:
EAGLE: attach scc 1 init 2e8 8 2 0 1 0 2 p3686400 1
PC-100: attach scc 1 init 2e8 16 6 4 1 0 2 p4915200 2 22
PRIMUS: attach scc 1 init 2e8 4 2 0 1 0 2 r2457600 4 02
DRSI: attach scc 1 init 300 16 2 0 1 0 2 p4915200 8
When using an AT-type machine (with two 8259 interrupt
controllers), and using the "interrupt 2" line on the BUS,
specify interrupt number 9 instead of 2. This better reflects
the actual configuration. The BIOS will attempt the redirection
of interrupt vector #9 to #2, but it does not completely do the
job.
The SCC driver uses the "buffers" feature that pre-allocates a
number of receiver buffers to be used by the drivers at interrupt
time. Be sure to issue a "buffers <n>" command before you attach
any of the SCC's channels (see below). The <n> parameter of the
buffers command specifies the number of buffers to pre-allocate,
this is a function of the number of channels you will attach, the
baudrate of the channels, the activity on each of these channels,
and the time the computer can spend without re-allocating new
buffers. A good number of receiver buffers to try is 32. If you
see a non-zero number in the "Space" column in the SCCSTAT output
(see below) you can increase this number. It specifies the
number of 128-byte buffers that are pre-allocated for the
receiver buffers of all channels attached. So in this case,
4Kbytes are allocated.
It is also possible to set the size of the buffers to be
allocated, using the 2nd and 3rd argument of the "buffers"
command. These set a minimal and maximal size of each buffer.
The PC version will only allocate buffers of the maximum size
(and ignores the second argument), but the Atari ST versions
minimizes the thrashing of the memory freelist by allocating
buffers between the minimal and maximal size, that can be carved
out of the freelist without further splitting blocks of memory.
Example: buffers 64 10 128
2. Attach commands
When the SCC driver has been initialized, you can attach the
channels. This is done using one of 3 forms of the "attach scc"
command:
attach scc <channel> slip <mtu> <baudrate>
attach scc <channel> kiss <mtu> <baudrate> <callsign>
attach scc <channel> ax25 <mtu> <baudrate> <callsign>
These will be refferred to as "slip", "kiss" and "ax25" mode.
The <channel> parameter specifies which half of which SCC will be
programmed, as follows:
channel 0: "A" side of first SCC
channel 1: "B" side of first SCC
channel 2: "A" side of second SCC
channel 3: "B" side of second SCC
etcetera. The channel number ranges from 0 to (2 * nchips) - 1,
where nchips is the number of chips specified in the
"attach scc init" command.
SLIP mode
This can be used for a link to another machine, when the channel
has an RS232 interface. Example:
attach scc 0 slip sl0 256 9600
This attaches the "A" side of the first SCC as interface "sl0",
with an MTU of 256 and an initial baudrate of 9600. The baudrate
can be changed later by:
param sl0 <baudrate>
Entering just "param sl0" will display the current baudrate.
KISS mode
KISS mode can be used to talk to a KISS TNC. It can also be used
on an asynchronous link to another computer running NET.
The difference with SLIP is that the interface will be AX.25
type, and can therefore be used for AX.25 connections. A
callsign must be given as a parameter, this will be used for IP
and NET/ROM purposes on the interface. Example:
attach scc 2 kiss 430 256 4800 pe1chl-7
In the example the "A" side of the second SCC will be attached as
interface "430" using an MTU of 256, a baudrate of 4800 and the
callsign PE1CHL-7.
The command "param 430 <paramnum> <decimal value>" can be used to
set the parameters of the KISS TNC. It is not possible to
display the current settings.
AX.25 mode
This is probably the most interesting mode to use with this
interface. It allows AX.25 communication without a TNC. Only a
MODEM is needed. Example:
attach sc